home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!usenet
- From: budge@clark.net (Joe Budge)
- Newsgroups: comp.lang.c++
- Subject: BC++ 4.52 - A CodeGuard bug, or mine?
- Date: 25 Mar 1996 20:06:18 GMT
- Organization: Clark Internet Services, Inc.
- Message-ID: <4j6ubq$24l@clarknet.clark.net>
- NNTP-Posting-Host: budge.clark.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.14
-
- I am experiencing a sporadic error message from CodeGuard which
- makes no sense to me. Any tips that anyone can provide as to
- what the cause may be or how I may narrow this down would be
- greatly appreciated.
-
- I'm building an application under BCPP 4.53 for Windows 3.11
- using the large memory model. At inconsistent times CodeGuard
- interrupts with a 'Bad Parameter' message: 'A bad object
- (0x00000000) has been passed to the function. delete(0xhhhh:hhhh)"
- [Where h = address of delete() in my .exe]. The lowest level
- of the call stack with source code always points to the line
- containing the 'new' operator in one of several code fragments
- that look like:
-
- char * szDest ;
- szDest = new char[n + 1] ;
- assert( szDest != NULL ) ;
-
- This is puzzling, as I am not calling delete() anywhere that I
- can tell in the flagged code (yes, I do call it elsewhere). I
- can't find anywhere that the BC++ source for operator new() calls
- delete() either.
-
- In the above fragment, 'n' is of type size_t and is passed to the
- function containing the code fragment as a parameter. There doesn't
- seem to be any relationship between its value and the failure.
-
- If I set a breakpoint on the offending line or break elsewhere and
- set watches on either of the variables involved, the failure never
- occurs. This means I can't tell what's really going on. I've tried
- initializing szDest to different values - doesn't make a difference.
-
- Of course I've checked the installation of CodeGuard. There is
- no apparent problem if I build & run without CodeGuard, and there's
- no apparent problem if I build & run for 32-bit windows. Now I'm at
- wit's end and am beginning to suspect that the problem is in
- CodeGuard, not in anything I've done. Any suggestions would be
- greatly appreciated.
-
- Thanks in advance,
- Joe Budge
-
-
-